package fr.gaulupeau.apps.Poche.tts;

import android.support.v4.media.session.PlaybackStateCompat;

public enum TtsServiceState {

    /**
     * CREATED State.
     * Initialize everything, but do not get audio focus or activate audio session yet.
     */
    CREATED(PlaybackStateCompat.STATE_NONE),

    /**
     * WANT_TO_PLAY State.
     * Not yet ready to play (tts not initialized, document not parsed, or audio focus lost).
     * get audio focus and activate audio session.
     */
    WANT_TO_PLAY(PlaybackStateCompat.STATE_BUFFERING),

    /**
     * PLAYING State.
     */
    PLAYING(PlaybackStateCompat.STATE_PLAYING),

    /**
     * PAUSED State.
     */
    PAUSED(PlaybackStateCompat.STATE_PAUSED),

    /**
     * STOPPED State.
     * Same as PAUSED, except no notification.
     */
    STOPPED(PlaybackStateCompat.STATE_STOPPED),

    /**
     * DESTROYED State.
     * Abandon audio focus and deactivate audio session.
     * => destroy service
     */
    DESTROYED(PlaybackStateCompat.STATE_STOPPED),

    /**
     * ERROR State.
     * Like TTS initialization failure.
     */
    ERROR(PlaybackStateCompat.STATE_ERROR);

    final int playbackState;

    TtsServiceState(int playbackState) {
        this.playbackState = playbackState;
    }

}
